/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controleur;

import application.AuteurBean;
import application.Facade;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author James
 */
public class CommandeAfficherAuteur implements Commande {
    private String next;

    public CommandeAfficherAuteur(String next) {
        this.next = next.toLowerCase();
    }

    @Override
    public String executer(HttpServletRequest req, HttpServletResponse res) throws CommandeException {
        Facade f = new Facade();
        AuteurBean auteurBean = f.getAuteur(req.getParameter("idAuteur"));
        
        req.setAttribute(ConstantesWeb.VALEUR_AUTEUR, auteurBean);
        
        return next;
    }
}
